package com.king.designpatterns.hybriddesignpattern.hybriddesignpattern.chainofcommandandresponsibility;

import java.util.ArrayList;
import java.util.List;

public enum CommandEnum {
    ls("com.king.designpatterns.hybriddesignpattern.hybriddesignpattern.chainofcommandandresponsibility.LSCommand");
    private String value = "";

    CommandEnum(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    // 返回所有的enum对象
    public static List<String> getNames(){
        CommandEnum[] commandEnums = CommandEnum.values();
        List<String> names = new ArrayList<>();
        for (CommandEnum c : commandEnums) {
            names.add(c.name());
        }
        return names;
    }
}
